def precision_recall(confusion_matrix):
    """
    n a 或者c 2分类问题
    y_sensitivity_n = 0
    y_specificity_n = confusion_matrix[0][0] / (confusion_matrix[0][0] + confusion_matrix[1][0]) # 特异性
    y_sensitivity_a = confusion_matrix[1][1] / (confusion_matrix[1][1] + confusion_matrix[0][1]) # 敏感性
    y_specificity_a = 0
    y_sensitivity_c, y_specificity_c = 0,0
    """

    # n a c 3分类
    # n  0
    y_sensitivity_n = 0
    y_specificity_n = confusion_matrix[0][0] / (
            confusion_matrix[0][0] + confusion_matrix[1][0] + confusion_matrix[2][0]) # Specificity
    # a  1
    y_sensitivity_a = 0 # Sensitivity
    y_specificity_a = confusion_matrix[1][1] / (
            confusion_matrix[1][1] + confusion_matrix[0][1] + confusion_matrix[2][1])   # Specificity
    # c 2
    y_sensitivity_c = 0  # Sensitivity
    y_specificity_c = confusion_matrix[2][2] / (
            confusion_matrix[2][2] + confusion_matrix[0][2] + confusion_matrix[1][2])  # Specificity

    return y_sensitivity_n, y_specificity_n, y_sensitivity_a, y_specificity_a, y_sensitivity_c, y_specificity_c
